package sg.edu.nus.iss.billing.entity.transaction;

import java.io.Serializable;
import java.util.Date;

import sg.edu.nus.iss.billing.entity.PaymentHistory;

public class CallTransaction extends Transaction implements Serializable , Comparable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 8198515102478547557L;
	private CallType callType;
	private String hostNumber;
	private String numberCall;
	private Date callTime;
	private long durationInSeconds;
	
	public CallTransaction(CallType callType, String hostNumber, String numberCall, Date callTime, long durationInSeconds) {
		
		this.callType = callType;
		this.hostNumber = hostNumber;
		this.numberCall = numberCall;
		this.callTime = callTime;
		this.durationInSeconds = durationInSeconds;
		
	}

	/**
	 * @return the callType
	 */
	public CallType getCallType() {
		return callType;
	}

	/**
	 * @param callType the callType to set
	 */
	public void setCallType(CallType callType) {
		this.callType = callType;
	}

	/**
	 * @return the hostNumber
	 */
	public String getHostNumber() {
		return hostNumber;
	}

	/**
	 * @param hostNumber the hostNumber to set
	 */
	public void setHostNumber(String hostNumber) {
		this.hostNumber = hostNumber;
	}

	/**
	 * @return the numberCall
	 */
	public String getNumberCall() {
		return numberCall;
	}

	/**
	 * @param numberCall the numberCall to set
	 */
	public void setNumberCall(String numberCall) {
		this.numberCall = numberCall;
	}

	/**
	 * @return the callTime
	 */
	public Date getCallTime() {
		return callTime;
	}

	/**
	 * @param callTime the callTime to set
	 */
	public void setCallTime(Date callTime) {
		this.callTime = callTime;
	}

	/**
	 * @return the durationInSeconds
	 */
	public long getDurationInSeconds() {
		return durationInSeconds;
	}

	/**
	 * @param durationInSeconds the durationInSeconds to set
	 */
	public void setDurationInSeconds(long durationInSeconds) {
		this.durationInSeconds = durationInSeconds;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "CallTransaction [callTime=" + callTime + ", callType="
				+ callType + ", durationInSeconds=" + durationInSeconds
				+ ", hostNumber=" + hostNumber + ", numberCall=" + numberCall
				+ "]";
	}
	
	@Override
	public int compareTo(Object obj) {
		// TODO Auto-generated method stub
		CallTransaction callTransaction = (CallTransaction)obj;
		return this.getCallTime().compareTo(callTransaction.getCallTime());
		
	}

}
